<?php get_header(); ?>
<!--分类模板-->
<!--来源于single.php-->

<div class="single-bj" style="background-image: url(<?php
					$full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full');
					echo $full_image_url[0];?>); ">
	<div class="single-main-header">
		<div class="single-main-txt">
		
<!--文章标题-->
		<div class="single-title">
			<!--分类标题-->分类<?php echo single_cat_title( '', false ) ; ?>下的文章</div>
		
		<!--博文附加内容-->
			<div class="single-meta">  
							
				<!--分类描述-->
描述：<?php
	$category_description = category_description();
	if ( !empty( $category_description ) ) echo  $category_description ;
?>
			
<!--分类下的文章数量-->
共：<?php
    global $wp_query;
    $cat_ID = get_query_var('cat');
    $category = get_category($cat_ID);
    echo $category->count;
?>篇
			</div>
		
	</div>
	</div>
</div>
















<!--来源于index.php-->
<div class="index-box">
		<?php
			if( have_posts() ){
				while( have_posts() ){
				//获取下一篇文章的信息，并且将信息存入全局变量 $post 中
				the_post();
				?>					
	<!---->
	
				<div class="index-text-box" style="background-image: url(<?php
					$full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full');
					echo $full_image_url[0];?>); ">
					
					<div class="index-content">
						<div class="index-text">	
<!--博文页标题：https://www.npc.ink/2921.html-->
				<div class="index-title">
				<a href="<?php the_permalink(); ?>">
					<?php echo wp_trim_words( get_the_title(), 30 ); // 文章标题?>
					</a>
					</div>
								
								<div class="index-meat">
								<!--创建博文时间：-->
							<a><?php the_time( 'Y.m.d' ); ?>&nbsp;&nbsp;•&nbsp;&nbsp;</a>

								
							<!--类别：-->
							<?php the_category(','); ?>
									
									
									
							<!--管理员登陆显示编辑-->
							
							<a href="<?php echo get_edit_post_link(); ?>">	
								<?php if( current_user_can('administrator') ) {
								echo '&nbsp;&nbsp;•&nbsp;&nbsp;编辑';}?></a>
								
								
								</div>
								</div>
							
						</div>
</div>
					<?php
				}
			}else{
				echo '没有博文可以显示';
			}
		?>
							
		<!--底部分页按钮-->
	<div class="index-button">
		<div class="index-button-next">
			<?php posts_nav_link( "&nbsp;&nbsp;&nbsp;&nbsp;", "返回" ); ?>
			</div>
		</div>
</div>
<?php get_footer(); ?>